package topcoder.srm590;

public class FoxAndGomoku {
	
	public String win(String[] board)
	{
		String m = "ooooo";
		for(String b: board)
			if(b.indexOf(m) >=0)
				return "found";
		
		for(int j = 0; j < board[0].length() ; j++) {
			for(int i = 0; i < board.length - 5; i++) {
				if( board[i].charAt(j) == 'o' && 
					board[i+1].charAt(j) == 'o' &&
					board[i+2].charAt(j) == 'o' &&
					board[i+3].charAt(j) == 'o' &&
					board[i+4].charAt(j) == 'o'
					)
					return "found";
			}
		}
		
		return "not found";
		
	}

	public static void main(String[] args) {
		FoxAndGomoku fg = new FoxAndGomoku();
		
		String[] board = {"o....",
				 "o.o..",
				 "o.o.o",
				 "o.o..",
				 "o...."}
;
		
		System.out.println(fg.win(board));

	}

}
